<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <!-- vue2 template模板中只能有一个根元素 -->
    <!-- vue3 允许template模板有多个根元素 -->
    <div id="app"></div>
    <template id="pengfan">
      <!-- 1.v-bind的基本使用 -->
      <img v-bind:src="imgUrl" alt="" />
      <a v-bind:href="link">百度一下</a>

      <!-- 1.v-bind提供的语法糖 -->
      <img :src="imgUrl" alt="" />
      <a :href="link">百度一下</a>
    </template>
    <script src="../js/vue.js"></script>
    <script>
      Vue.createApp({
        template: "#pengfan",
        data() {
          return {
            message: "Hello World",
            imgUrl: "https://avatars.githubusercontent.com/u/10335230?s=60&v=4",
            link: "https://www.baidu.com",
          };
        },
        methods: {},
      }).mount("#app");
    </script>
  </body>
</html>
